package editor.animation;

import com.crunch.math.Vector2f;

import javax.swing.*;

public abstract class EditorPanel extends JPanel {
	public abstract String getTabName();
	public abstract void deselect();
	public abstract void select();
	public abstract void close();

	// commands that can be performed in the preview window
	// note: these functions aren't performed immediately
	// they are called with "invokeLater()"
	// for this reason, we should check to make sure the command is still valid instead of blindly performing it

	// called when a bone in the preview window is selected
	public abstract void selectBoneInPreview(int boneIndex);

	// used to translate a bone
	public abstract void translateInPreview(Vector2f translation);
	public abstract void finishTranslateInPreview();

	// used to rotate a bone
	public abstract void rotateInPreview(float rotation);
	public abstract void finishRotateInPreview();

	// used to scale a bone
	public abstract void scaleInPreview(Vector2f scale);
	public abstract void finishScaleInPreview();

	// used to get bone information
	public abstract Vector2f getBoneTranslation(int boneIndex);
	public abstract float getBoneRotation(int boneIndex);
	public abstract Vector2f getBoneScale(int boneIndex);

	// used to control animation properties of the selected bone
	public abstract void enableBoneInAnimationInPreview();
	public abstract void addKeyframeInPreview();
	public abstract void prevKeyframeInPreview(boolean first);
	public abstract void nextKeyframeInPreview(boolean last);

	// called when a frame in the preview begins
	public abstract void frameBeginInPreview();
}
